Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is_js

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is_js

micro check library

  • 0.8.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
646K
increased by12.29%
Maintainers
1
Weekly downloads
 
Created

What is is_js?

The is_js npm package provides a collection of type-checking and validation functions. It allows developers to easily check the type of a variable, validate data, and perform various checks on strings, numbers, and other data types.

What are is_js's main functionalities?

Type Checking

This feature allows you to check the type of a variable. The code sample demonstrates how to check if a variable is a string, number, or array.

const is = require('is_js');
console.log(is.string('Hello')); // true
console.log(is.number(123)); // true
console.log(is.array([1, 2, 3])); // true

Presence Checks

This feature allows you to check for the presence or absence of values. The code sample shows how to check if an array is empty, if a value exists, and if a value is truthy.

const is = require('is_js');
console.log(is.empty([])); // true
console.log(is.existy(null)); // false
console.log(is.truthy(1)); // true

String Checks

This feature allows you to perform various checks on strings. The code sample demonstrates how to check if a string is a valid URL, email, or credit card number.

const is = require('is_js');
console.log(is.url('https://www.example.com')); // true
console.log(is.email('test@example.com')); // true
console.log(is.creditCard('4111111111111111')); // true

Environment Checks

This feature allows you to check the environment in which the code is running. The code sample shows how to check if the browser is Internet Explorer, if the device is mobile, and if the operating system is Windows.

const is = require('is_js');
console.log(is.ie()); // false (depends on the browser)
console.log(is.mobile()); // false (depends on the device)
console.log(is.windows()); // true (depends on the OS)

Other packages similar to is_js

FAQs

Package last updated on 14 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc